package com.wd.jdbc;

import java.sql.Connection;
import java.sql.PreparedStatement;

import org.springframework.stereotype.Component;

import com.wd.model.LogJob;

@Component
public class LobJobService extends AbstractService {

	public void insertData(LogJob logJob) {

		Connection con = null;
		PreparedStatement pst = null;
		try {
			con = getConnection();
			String sql = "insert into app_log_job(type,createtime,remark) values(?,now(),?)";
			pst = con.prepareStatement(sql);
			pst.setString(1, logJob.getType());
			pst.setString(2, logJob.getRemark());
			pst.execute();
		} catch (Exception ex) {
			ex.printStackTrace();
		} finally {
			CloseConnection(con);
		}
	}
}
